home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_emacs.idb / usr / freeware / info / mh-e-2.z / mh-e-2
Encoding:
GNU Info File  |  1998-10-28  |  45.6 KB  |  1,141 lines

  1. This is Info file ../info/mh-e, produced by Makeinfo-1.63 from the
  2. input file mh-e.texi.
  3.  
  4.    This is Edition 1.2, last updated 22 August 1995, of `mh-e, The
  5. Emacs Interface to MH', for mh-e, Version 5.0.2.
  6.  
  7.    Copyright 1995 Free Software Foundation, Inc.
  8.  
  9.    Permission is granted to make and distribute verbatim copies of this
  10. manual provided the copyright notice and this permission notice are
  11. preserved on all copies.
  12.  
  13.    Permission is granted to copy and distribute modified versions of
  14. this manual under the conditions for verbatim copying, provided also
  15. that the section entitled "Copying" is included exactly as in the
  16. original, and provided that the entire resulting derived work is
  17. distributed under the terms of a permission notice identical to this
  18. one.
  19.  
  20.    Permission is granted to copy and distribute translations of this
  21. manual into another language, under the above conditions for modified
  22. versions, except that this permission notice may be stated in a
  23. translation approved by the Free Software Foundation.
  24.  
  25. 
  26. File: mh-e,  Node: Organizing,  Next: Printing,  Prev: Deleting,  Up: Moving Mail
  27.  
  28. Organizing Your Mail with Folders
  29. ---------------------------------
  30.  
  31.    mh-e has analogies for each of the MH `folder' and `refile'
  32. commands.  To refile a message in another folder, use the `o'
  33. (`mh-refile-msg') (mnemonic: "output") command.  You are prompted for
  34. the folder name.
  35.  
  36.    If you are refiling several messages into the same folder, you can
  37. use the `!' (`mh-refile-or-write-again') command to repeat the last
  38. refile or write (see the description of `C-o' in *Note Files and
  39. Pipes::).  Or, place the messages into a sequence (*Note Sequences::)
  40. and specify a prefix argument to `o', in which case you'll be prompted
  41. for the name of the sequence (for example, `C-u o search RET').
  42.  
  43.    If you wish to copy a message to another folder, you can use the `c'
  44. (`mh-copy-msg') command (see the `-link' argument to `refile'(1)).  You
  45. are prompted for a folder, and you can specify a prefix argument if you
  46. want to copy a sequence into another folder.  In this case, you are
  47. then prompted for the sequence.  Note that unlike the `o' command, the
  48. copy takes place immediately.  The original copy remains in the current
  49. folder.
  50.  
  51.    When you want to read the messages that you have refiled into
  52. folders, use the `M-f' (`mh-visit-folder') command to visit the folder.
  53. You are prompted for the folder name.
  54.  
  55.    Other commands you can perform on folders include: `M-l'
  56. (`mh-list-folders'), to list all the folders in your mail directory;
  57. `M-k' (`mh-kill-folder'), to remove a folder; `M-x mh-sort-folder', to
  58. sort the messages by date (see `sortm'(1) to see how to sort by other
  59. criteria); `M-p' (`mh-pack-folder'), to pack a folder, removing gaps
  60. from the numbering sequence; and `M-r' (`mh-rescan-folder'), to rescan
  61. the folder, which is useful to grab all messages in your `+inbox' after
  62. processing your new mail for the first time.  If you don't want to
  63. rescan the entire folder, give `M-r' or `M-p' a prefix argument and
  64. you'll be prompted for a range of messages to display (for instance,
  65. `C-u M-r last:50 RET').
  66.  
  67. 
  68. File: mh-e,  Node: Printing,  Next: Files and Pipes,  Prev: Organizing,  Up: Moving Mail
  69.  
  70. Printing Your Mail
  71. ------------------
  72.  
  73.    Printing mail is simple.  Enter `l' (`mh-print-msg') (for line
  74. printer or lpr).  The message is formatted with `mhl' and printed with
  75. the `lpr' command.  You can print all the messages in a sequence by
  76. specifying a prefix argument, in which case you are prompted for the
  77. name of the sequence (as in `C-u l frombob RET').
  78.  
  79. 
  80. File: mh-e,  Node: Files and Pipes,  Next: Finishing Up,  Prev: Printing,  Up: Moving Mail
  81.  
  82. Files and Pipes
  83. ---------------
  84.  
  85.    mh-e does offer a couple of commands that are not a part of MH.  The
  86. first one, `C-o' (`mh-write-msg-to-file'), writes a message to a file
  87. (think of the `o' as in "output").  You are prompted for the filename.
  88. If the file already exists, the message is appended to it.  You can
  89. also write the message to the file without the header by specifying a
  90. prefix argument (such as `C-u C-o /tmp/foobar RET').  Subsequent writes
  91. to the same file can be made with the `!' command.
  92.  
  93.    You can also pipe the message through a Unix shell command with the
  94. `|' (`mh-pipe-msg') command.  You are prompted for the Unix command
  95. through which you wish to run your message.  If you give an argument to
  96. this command, the message header is included in the text passed to the
  97. command (the contrived example `C-u | lpr' would be done with the `l'
  98. command instead).
  99.  
  100.    If the message is a shell archive `shar' or has been run through
  101. `uuencode' use `M-n' (`mh-store-msg') to extract the body of the
  102. message.  The default directory for extraction is the current
  103. directory, and you have a chance to specify a different extraction
  104. directory.  The next time you use this command, the default directory is
  105. the last directory you used.
  106.  
  107. 
  108. File: mh-e,  Node: Finishing Up,  Prev: Files and Pipes,  Up: Moving Mail
  109.  
  110. Finishing Up
  111. ------------
  112.  
  113.    If you've deleted a message or refiled it, but changed your mind, you
  114. can cancel the action before you've executed it.  Use `u' (`mh-undo')
  115. to undo a refile on or deletion of a single message.  You can also undo
  116. refiles and deletes for messages that belong to a given sequence by
  117. specifying a prefix argument.  You'll be prompted for the name of the
  118. sequence (as in `C-u u frombob RET').  Alternatively, you can use `M-u'
  119. (`mh-undo-folder') to undo all refiles or deletes in the current folder.
  120.  
  121.    If you've marked messages to be deleted or refiled and you want to go
  122. ahead and delete or refile the messages, use `x'
  123. (`mh-execute-commands').  Many mh-e commands that may affect the
  124. numbering of the messages (such as `M-r' or `M-p') will ask if you want
  125. to process refiles or deletes first and then either run `x' for you or
  126. undo the pending refiles and deletes, which are lost.
  127.  
  128.    When you want to quit using mh-e and go back to editing, you can use
  129. the `q' (`mh-quit') command.  This buries the buffers of the current
  130. mh-e folder and restores the buffers that were present when you first
  131. ran `M-x mh-rmail'.  You can later restore your mh-e session by
  132. selecting the `+inbox' buffer or by running `M-x mh-rmail' again.
  133.  
  134. 
  135. File: mh-e,  Node: Searching,  Next: Sequences,  Prev: Moving Mail,  Up: Using mh-e
  136.  
  137. Searching Through Messages
  138. ==========================
  139.  
  140.    You can search a folder for messages to or from a particular person
  141. or about a particular subject.  In fact, you can also search for
  142. messages containing selected strings in any arbitrary header field or
  143. any string found within the messages.  Use the `M-s'
  144. (`mh-search-folder') command.  You are first prompted for the name of
  145. the folder to search and then placed in the following buffer in MH-Pick
  146. mode:
  147.  
  148.      From: #
  149.      To:
  150.      Cc:
  151.      Date:
  152.      Subject:
  153.      --------
  154.      
  155.      
  156.      
  157.      
  158.      
  159.      
  160.      
  161.      
  162.      
  163.      --**-Emacs: pick-pattern    (MH-Pick)------All----------------------------
  164.      Pick window
  165.  
  166.    Edit this template by entering your search criteria in an appropriate
  167. header field that is already there, or create a new field yourself.  If
  168. the string you're looking for could be anywhere in a message, then place
  169. the string underneath the row of dashes.  The `M-s' command uses the MH
  170. command `pick' to do the real work, so read `pick'(1) to find out more
  171. about how to enter the criteria.
  172.  
  173.    There are no semantics associated with the search criteria--they are
  174. simply treated as strings.  Case is ignored when all lowercase is used,
  175. and regular expressions (a la `ed') are available.  It is all right to
  176. specify several search criteria.  What happens then is that a logical
  177. *and* of the various fields is performed.  If you prefer a logical *or*
  178. operation, run `M-s' multiple times.
  179.  
  180.    As an example, let's say that we want to find messages from Ginnean
  181. about horseback riding in the Kosciusko National Park (Australia) during
  182. January, 1994.  Normally we would start with a broad search and narrow
  183. it down if necessary to produce a manageable amount of data, but we'll
  184. cut to the chase and create a fairly restrictive set of criteria as
  185. follows:
  186.  
  187.      From: ginnean
  188.      To:
  189.      Cc:
  190.      Date: Jan 1994
  191.      Subject: horse.*kosciusko
  192.      --------
  193.  
  194.    As with MH-Letter mode, MH-Pick provides commands like `C-c C-f C-t'
  195. to help you fill in the blanks.
  196.  
  197. `C-c C-f C-t'
  198.      Move to `To:' header field (`mh-to-field').
  199.  
  200. `C-c C-f C-c'
  201.      Move to `cc:' header field (`mh-to-field').
  202.  
  203. `C-c C-f C-s'
  204.      Move to `Subject:' header field (`mh-to-field').
  205.  
  206. `C-c C-f C-f'
  207.      Move to `From:' header field (`mh-to-field').
  208.  
  209. `C-c C-f C-b'
  210.      Move to `Bcc:' header field (`mh-to-field').
  211.  
  212. `C-c C-f C-f'
  213.      Move to `Fcc:' header field (`mh-to-field').
  214.  
  215. `C-c C-f C-d'
  216.      Move to `Dcc:' header field (`mh-to-field').
  217.  
  218. `C-c C-c'
  219.      Execute the search (`mh-do-pick-search').
  220.  
  221.    To perform the search, type `C-c C-c' (`mh-do-pick-search').  The
  222. selected messages are placed in the search sequence, which you can use
  223. later in forwarding (*note Forwarding::.), printing (*note
  224. Printing::.), or narrowing your field of view (*note Sequences::.).
  225. Subsequent searches are appended to the search sequence.  If, however,
  226. you wish to start with a clean slate, first delete the search sequence
  227. (how to do this is discussed in *Note Sequences::).
  228.  
  229.    If you're searching in a folder that is already displayed in a
  230. MH-Folder buffer, only those messages contained in the buffer are used
  231. for the search.  Therefore, if you want to search in all messages,
  232. first kill the folder's buffer with `C-x k' or scan the entire folder
  233. with `M-r'.
  234.  
  235. 
  236. File: mh-e,  Node: Sequences,  Next: Miscellaneous,  Prev: Searching,  Up: Using mh-e
  237.  
  238. Using Sequences
  239. ===============
  240.  
  241.    For the whole scoop on MH sequences, refer to `mh-sequence'(5).  As
  242. you've read, several of the mh-e commands can operate on a sequence,
  243. which is a shorthand for a range or group of messages.  For example, you
  244. might want to forward several messages to a friend or colleague.  Here's
  245. how to manipulate sequences.
  246.  
  247. `%'
  248.      Put message in a sequence (`mh-put-msg-in-seq').
  249.  
  250. `?'
  251.      Display sequences that message belongs to (`mh-msg-is-in-seq').
  252.  
  253. `M-q'
  254.      List all sequences in folder (`mh-list-sequences').
  255.  
  256. `M-%'
  257.      Remove message from sequence (`mh-delete-msg-from-seq').
  258.  
  259. `M-#'
  260.      Delete sequence (`mh-delete-seq').
  261.  
  262. `C-x n'
  263.      Restrict display to messages in sequence (`mh-narrow-to-seq').
  264.  
  265. `C-x w'
  266.      Remove restriction; display all messages (`mh-widen').
  267.  
  268. `M-x mh-update-sequences'
  269.      Push mh-e's state out to MH.
  270.  
  271.    To place a message in a sequence, use `%' (`mh-put-msg-in-seq') to
  272. do it manually, or use the MH command `pick' or the mh-e version of
  273. `pick' (*Note Searching::) which create a sequence automatically.  Give
  274. `%' a prefix argument and you can add all the messages in one sequence
  275. to another sequence (for example, `C-u % SourceSequence RET').
  276.  
  277.    Once you've placed some messages in a sequence, you may wish to
  278. narrow the field of view to just those messages in the sequence you've
  279. created.  To do this, use `C-x n' (`mh-narrow-to-seq').  You are
  280. prompted for the name of the sequence.  What this does is show only
  281. those messages that are in the selected sequence in the MH-Folder
  282. buffer.  In addition, it limits further mh-e searches to just those
  283. messages.  When you want to widen the view to all your messages again,
  284. use `C-x w' (`mh-widen').
  285.  
  286.    You can see which sequences a message is in with the `?'
  287. (`mh-msg-is-in-seq') command.  Or, you can list all sequences in a
  288. selected folder (default is current folder) with `M-q'
  289. (`mh-list-sequences').
  290.  
  291.    If you want to remove a message from a sequence, use `M-%'
  292. (`mh-delete-msg-from-seq'), and if you want to delete an entire
  293. sequence, use `M-#' (`mh-delete-seq').  In the latter case you are
  294. prompted for the sequence to delete.  Note that this deletes only the
  295. sequence, not the messages in the sequence.  If you want to delete the
  296. messages, use `C-u d' (see *Note Deleting:: above).
  297.  
  298.    Two sequences are maintained internally by mh-e and pushed out to MH
  299. when you type either the `x' or `q' command.  They are the sequence
  300. specified by your `Unseen-Sequence:' profile entry and cur.  However,
  301. you can also just update MH's state with the command `M-x
  302. mh-update-sequences'.  See *Note Customizing Viewing:: for an example
  303. of how this command might be used.
  304.  
  305.    With the exceptions of `C-x n' and `C-x w', the underlying MH
  306. command dealing with sequences is `mark'.
  307.  
  308. 
  309. File: mh-e,  Node: Miscellaneous,  Prev: Sequences,  Up: Using mh-e
  310.  
  311. Miscellaneous Commands
  312. ======================
  313.  
  314.    One other command worth noting is `M-x mh-version'.  Since there
  315. were a few changes in command letters between Versions 3 and 4, use
  316. this command to see which version you are running.  This command didn't
  317. exist before Version 4, so the message `[No match]' indicates that it's
  318. time to upgrade (*note Getting mh-e::.).  In the meantime, use the
  319. older commands that are listed in *Note Changes to mh-e::.  The output
  320. of `M-x mh-version' should also be included with any bug report you
  321. send (*note Bug Reports::.).
  322.  
  323. 
  324. File: mh-e,  Node: Customizing mh-e,  Next: Odds and Ends,  Prev: Using mh-e,  Up: Top
  325.  
  326. Customizing mh-e
  327. ****************
  328.  
  329.    Until now, we've talked about the mh-e commands as they work "out of
  330. the box."  Of course, it is also possible to reconfigure mh-e beyond
  331. recognition.  The following sections describe all of the customization
  332. variables, show the defaults, and make recommendations for
  333. customization.  The outline of this chapter is identical to that of
  334. *Note Using mh-e::, to make it easier to find the variables you'd need
  335. to modify to affect a particular command.
  336.  
  337.    However, when customizing your mail environment, first try to change
  338. what you want in MH, and only change mh-e if changing MH is not
  339. possible.  That way you will get the same behavior inside and outside
  340. GNU Emacs.  Note that mh-e does not provide hooks for customizations
  341. that can be done in MH; this omission is intentional.
  342.  
  343.    Many string or integer variables are easy enough to modify using
  344. Emacs Lisp.  Any such modifications should be placed in a file called
  345. `.emacs' in your home directory (that is, `~/.emacs').  For example, to
  346. modify the variable that controls printing, you could add:
  347.  
  348.      (setq mh-lpr-command-format "nenscript -G -r -2 -i'%s'")
  349.  
  350.    *Note Customizing Printing:: talks more about this variable.
  351.  
  352.    Variables can also hold Boolean values.  In Emacs Lisp, the Boolean
  353. values are `nil', which means false, and `t', which means true.
  354. Usually, variables are turned off by setting their value to `nil', as in
  355.  
  356.      (setq mh-bury-show-buffer nil)
  357.  
  358.    which keeps the MH-Show buffer at the top of the buffer stack.  To
  359. turn a variable on, you use
  360.  
  361.      (setq mh-bury-show-buffer t)
  362.  
  363.    which places the MH-Show buffer at the bottom of the buffer stack.
  364. However, the text says to turn on a variable by setting it to a
  365. *non-`nil'* value, because sometimes values other than `t' are
  366. meaningful (for example, see `mhl-formfile', described in *Note
  367. Customizing Viewing::).  Other variables, such as hooks, involve a
  368. little more Emacs Lisp programming expertise.
  369.  
  370.    You can also "preview" the effects of changing variables before
  371. committing the changes to `~/.emacs'.  Variables can be changed in the
  372. current Emacs session by using `M-x set-variable'.
  373.  
  374.    In general, "commands" in this text refer to Emacs Lisp functions.
  375. Programs outside of Emacs are specifically called MH commands, shell
  376. commands, or Unix commands.
  377.  
  378.    I hope I've included enough examples here to get you well on your
  379. way.  If you want to explore Emacs Lisp further, a programming manual
  380. does exist, (1) and you can look at the code itself for examples.  Look
  381. in the Emacs Lisp directory on your system (such as
  382. `/usr/local/lib/emacs/lisp') and find all the `mh-*.el' files there.
  383. When calling mh-e and other Emacs Lisp functions directly from Emacs
  384. Lisp code, you'll need to know the correct arguments.  Use the online
  385. help for this.  For example, try `C-h f mh-execute-commands RET'.  If
  386. you write your own functions, please do not prefix your symbols
  387. (variables and functions) with `mh-'.  This prefix is reserved for the
  388. mh-e package.  To avoid conflicts with existing mh-e symbols, use a
  389. prefix like `my-' or your initials.
  390.  
  391. * Menu:
  392.  
  393. * Customizing Reading::
  394. * Customizing Sending::
  395. * Customizing Draft Editing::
  396. * Customizing Moving Mail::
  397. * Customizing Searching::
  398.  
  399.    ---------- Footnotes ----------
  400.  
  401.    (1)  Perhaps you can find the online version of *Note The GNU Emacs
  402. Lisp Reference Manual: (elisp)Top.  If not, you can order a printed
  403. manual, which has the desirable side-effect of helping to support the
  404. Free Software Foundation which made all this great software available.
  405. You can find an order form by running `C-h C-d', or you can request an
  406. order form from gnu@prep.ai.mit.edu.
  407.  
  408. 
  409. File: mh-e,  Node: Customizing Reading,  Next: Customizing Sending,  Prev: Customizing mh-e,  Up: Customizing mh-e
  410.  
  411. Reading Your Mail
  412. =================
  413.  
  414.    I'll start out by including a function that I use as a front end to
  415. mh-e.  (1) It toggles between your working window configuration, which
  416. may be quite involved--windows filled with source, compilation output,
  417. man pages, and other documentation--and your mh-e window configuration.
  418. Like the rest of the customization described in this chapter, simply
  419. add the following code to `~/.emacs'.  Don't be intimidated by the size
  420. of this example; most customizations are only one line.
  421.  
  422.      Starting mh-e
  423.      
  424.      (defvar my-mh-screen-saved nil
  425.        "Set to non-`nil' when mh-e window configuration shown.")
  426.      (defvar my-normal-screen nil "Normal window configuration.")
  427.      (defvar my-mh-screen nil "mh-e window configuration.")
  428.      
  429.      (defun my-mh-rmail (&optional arg)
  430.        "Toggle between mh-e and normal screen configurations.
  431.      With non-`nil' or prefix argument, inc mailbox as well
  432.      when going into mail."
  433.        (interactive "P")                 ; user callable function, P=prefix arg
  434.        (setq my-mh-screen-saved          ; save state
  435.              (cond
  436.               ;; Bring up mh-e screen if arg or normal window configuration.
  437.               ;; If arg or +inbox buffer doesn't exist, run mh-rmail.
  438.               ((or arg (null my-mh-screen-saved))
  439.                (setq my-normal-screen (current-window-configuration))
  440.                (if (or arg (null (get-buffer "+inbox")))
  441.                    (mh-rmail)
  442.                  (set-window-configuration my-mh-screen))
  443.                t)                        ; set my-mh-screen-saved to `t'
  444.               ;; Otherwise, save mh-e screen and restore normal screen.
  445.               (t
  446.                (setq my-mh-screen (current-window-configuration))
  447.                (set-window-configuration my-normal-screen)
  448.                nil))))                   ; set my-mh-screen-saved to nil
  449.      
  450.      (global-set-key "\C-x\r" 'my-mh-rmail)  ; call with C-x RET
  451.  
  452.    If you type an argument (`C-u') or if `my-mh-screen-saved' is `nil'
  453. (meaning a non-mh-e window configuration), the current window
  454. configuration is saved, either +inbox is displayed or `mh-rmail' is
  455. run, and the mh-e window configuration is shown.  Otherwise, the mh-e
  456. window configuration is saved and the original configuration is
  457. displayed.
  458.  
  459.    Now to configure mh-e.  The following table lists general mh-e
  460. variables and variables that are used while reading mail.
  461.  
  462. `mh-progs'
  463.      Directory containing MH programs (default: dynamic).
  464.  
  465. `mh-lib'
  466.      Directory containing MH support files and programs (default:
  467.      dynamic).
  468.  
  469. `mh-do-not-confirm'
  470.      Don't confirm on non-reversible commands (default: `nil').
  471.  
  472. `mh-summary-height'
  473.      Number of scan lines to show (includes mode line) (default: 4).
  474.  
  475. `mh-folder-mode-hook'
  476.      Functions to run in MH-Folder mode (default: `nil').
  477.  
  478. `mh-clean-message-header'
  479.      Remove extraneous headers (default: `nil').
  480.  
  481. `mh-invisible-headers'
  482.      Headers to hide (default: `"^Received: \\| ^Message-Id: \\|
  483.      ^Remailed-\\| ^Via: \\| ^Mail-from: \\| ^Return-Path: \\|
  484.      ^In-Reply-To: \\| ^Resent-"').
  485.  
  486. `mh-visible-headers'
  487.      Headers to display (default: `nil').
  488.  
  489. `mhl-formfile'
  490.      Format file for `mhl' (default: `nil').
  491.  
  492. `mh-show-hook'
  493.      Functions to run when showing message (default: `nil').
  494.  
  495. `mh-show-mode-hook'
  496.      Functions to run when showing message (default: `nil').
  497.  
  498. `mh-bury-show-buffer'
  499.      Leave show buffer at bottom of stack (default: `t').
  500.  
  501. `mh-show-buffer-mode-line-buffer-id'
  502.      Name of show buffer in mode line (default: `"{show-%s} %d"').
  503.  
  504.    The two variables `mh-progs' and `mh-lib' are used to tell mh-e
  505. where the MH programs and supporting files are kept, respectively.
  506. mh-e does try to figure out where they are kept for itself by looking in
  507. common places and in the user's `PATH' environment variable, but if it
  508. cannot find the directories, or finds the wrong ones, you should set
  509. these variables.  The name of the directory should be placed in double
  510. quotes, and there should be a trailing slash (`/').  See the example in
  511. *Note Getting Started::.
  512.  
  513.    If you never make mistakes, and you do not like confirmations for
  514. your actions, you can set `mh-do-not-confirm' to a non-`nil' value to
  515. disable confirmation for unrecoverable commands such as `M-k'
  516. (`mh-kill-folder') and `M-u' (`mh-undo-folder').  Here's how you set
  517. boolean values:
  518.  
  519.      (setq mh-do-not-confirm t)
  520.  
  521.    The variable `mh-summary-height' controls the number of scan lines
  522. displayed in the MH-Folder window, including the mode line.  The
  523. default value of 4 means that 3 scan lines are displayed.  Here's how
  524. you set numerical values:
  525.  
  526.      (setq mh-summary-height 2)              ; only show the current scan line
  527.  
  528.    Normally the buffer for displaying messages is buried at the bottom
  529. at the buffer stack.  You may wish to disable this feature by setting
  530. `mh-bury-show-buffer' to `nil'.  One advantage of not burying the show
  531. buffer is that one can delete the show buffer more easily in an
  532. electric buffer list because of its proximity to its associated
  533. MH-Folder buffer.  Try running `M-x electric-buffer-list' to see what I
  534. mean.
  535.  
  536.    The hook `mh-folder-mode-hook' is called when a new folder is
  537. created with MH-Folder mode.  This could be used to set your own key
  538. bindings, for example:
  539.  
  540.      Create additional key bindings via mh-folder-mode-hook
  541.      
  542.      (defvar my-mh-init-done nil "Non-`nil' when one-time mh-e settings made.")
  543.      
  544.      (defun my-mh-folder-mode-hook ()
  545.        "Hook to set key bindings in MH-Folder mode."
  546.        (if (not my-mh-init-done)             ; only need to bind the keys once 
  547.            (progn
  548.              (local-set-key "/" 'search-msg)
  549.              (local-set-key "b" 'mh-burst-digest)    ; better use of `b'
  550.              (setq my-mh-init-done t))))
  551.      
  552.      ;;; Emacs 19
  553.      (add-hook 'mh-folder-mode-hook 'my-mh-folder-mode-hook)
  554.      ;;; Emacs 18
  555.      ;;;   (setq mh-folder-mode-hook (cons 'my-mh-folder-mode-hook
  556.      ;;;                               mh-folder-mode-hook))
  557.      
  558.      (defun search-msg ()
  559.        "Search for a regexp in the current message."
  560.        (interactive)                         ; user function
  561.        (save-window-excursion
  562.          (other-window 1)                    ; go to next window
  563.          (isearch-forward-regexp)))          ; string search; hit return (ESC
  564.                                              ;   in Emacs 18) when done
  565.  
  566. * Menu:
  567.  
  568. * Customizing Viewing::
  569. * Customizing Moving Around::
  570.  
  571.    ---------- Footnotes ----------
  572.  
  573.    (1)  Stephen Gildea's favorite binding is `(global-set-key "\C-cr"
  574. 'mh-rmail)'.
  575.  
  576. 
  577. File: mh-e,  Node: Customizing Viewing,  Next: Customizing Moving Around,  Prev: Customizing Reading,  Up: Customizing Reading
  578.  
  579. Viewing Your Mail
  580. -----------------
  581.  
  582.    Several variables control what displayed messages look like.
  583. Normally messages are delivered with a handful of uninteresting header
  584. fields.  You can make them go away by setting `mh-clean-message-header'
  585. to a non-`nil' value.  The header can then be cleaned up in two ways.
  586. By default, the header fields in `mh-invisible-headers' are removed.
  587. On the other hand, you could set `mh-visible-headers' to the fields
  588. that you would like to see.  If this variable is set,
  589. `mh-invisible-headers' is ignored.  I suggest that you not set
  590. `mh-visible-headers' since if you use this variable, you might miss a
  591. lot of header fields that you'd rather not miss.  As an example of how
  592. to set a string variable, `mh-visible-headers' can be set to show a
  593. minimum set of header fields (see (*Note Syntax of Regular Expressions:
  594. (emacs)Regexps, for a description of the special characters in this
  595. string):
  596.  
  597.      (setq mh-visible-headers "^From: \\|^Subject: \\|^Date: ")
  598.  
  599.    Normally mh-e takes care of displaying messages itself (rather than
  600. calling an MH program to do the work).  If you'd rather have `mhl'
  601. display the message (within mh-e), set the variable `mhl-formfile' to a
  602. non-`nil' value.  You can set this variable either to `t' to use the
  603. default format file or to a filename if you have your own format file
  604. (`mhl'(1) tells you how to write one).  When writing your own format
  605. file, use a nonzero value for `overflowoffset' to ensure the header is
  606. RFC 822 compliant and parsable by mh-e.  `mhl' is always used for
  607. printing and forwarding; in this case, the value of `mhl-formfile' is
  608. consulted if it is a filename.
  609.  
  610.    Two hooks can be used to control how messages are displayed.  The
  611. first hook, `mh-show-mode-hook', is called early on in the process of
  612. displaying of messages.  It is used to perform some actions on the
  613. contents of messages, such as highlighting the header fields.  If you're
  614. running Emacs 19 under the X Window System, the following example will
  615. highlight the `From:' and `Subject:' header fields.  This is a very
  616. nice feature indeed.
  617.  
  618.      Emphasize header fields in different fonts via mh-show-mode-hook
  619.      
  620.      (defvar my-mh-keywords
  621.         '(("^From: \\(.*\\)" 1 'bold t)
  622.           ("^Subject: \\(.*\\)" 1 'highlight t))
  623.        "mh-e additions for font-lock-keywords.")
  624.      
  625.      (defun my-mh-show-mode-hook ()
  626.        "Hook to turn on and customize fonts."
  627.        (require 'font-lock)                 ; for font-lock-keywords below
  628.        (make-local-variable 'font-lock-mode-hook) ; don't affect other buffers
  629.        (add-hook 'font-lock-mode-hook       ; set a hook with inline function
  630.                  (function                  ; modifies font-lock-keywords when
  631.                   (lambda ()                ; font-lock-mode run
  632.                     (setq font-lock-keywords
  633.                           (append my-mh-keywords font-lock-keywords)))))
  634.        (font-lock-mode 1))                  ; change the typefaces
  635.      
  636.      (if window-system                      ; can't do this on ASCII terminal
  637.          (add-hook 'mh-show-mode-hook 'my-mh-show-mode-hook))
  638.  
  639.    The second hook, `mh-show-hook', is the last thing called after
  640. messages are displayed.  It's used to affect the behavior of mh-e in
  641. general or when `mh-show-mode-hook' is too early.  For example, if you
  642. wanted to keep mh-e in sync with MH, you could use `mh-show-hook' as
  643. follows:
  644.  
  645.      (add-hook 'mh-show-hook 'mh-update-sequences)
  646.  
  647.    The function `mh-update-sequences' is documented in *Note Finishing
  648. Up::.  For those who like to modify their mode lines, use
  649. `mh-show-buffer-mode-line-buffer-id' to modify the mode line in the
  650. MH-Show buffers.  Place the two escape strings `%s' and `%d', which
  651. will display the folder name and the message number, respectively,
  652. somewhere in the string in that order.  The default value of
  653. `"{show-%s} %d"' yields a mode line of
  654.  
  655.      -----{show-+inbox} 4      (MH-Show)--Bot----------------------------------
  656.  
  657. 
  658. File: mh-e,  Node: Customizing Moving Around,  Prev: Customizing Viewing,  Up: Customizing Reading
  659.  
  660. Moving Around
  661. -------------
  662.  
  663.    When you use `t' (`mh-toggle-showing') to toggle between show mode
  664. and scan mode, the MH-Show buffer is hidden and the MH-Folder buffer is
  665. left alone.  Setting `mh-recenter-summary-p' to a non-`nil' value
  666. causes the toggle to display as many scan lines as possible, with the
  667. cursor at the middle.  The effect of `mh-recenter-summary-p' is rather
  668. useful, but it can be annoying on a slow network connection.
  669.  
  670. 
  671. File: mh-e,  Node: Customizing Sending,  Next: Customizing Draft Editing,  Prev: Customizing Reading,  Up: Customizing mh-e
  672.  
  673. Sending Mail
  674. ============
  675.  
  676.    You may wish to start off by adding the following useful key
  677. bindings to your `.emacs' file:
  678.  
  679.      (global-set-key "\C-xm" 'mh-smail)
  680.      (global-set-key "\C-x4m" 'mh-smail-other-window)
  681.  
  682.    In addition, several variables are useful when sending mail or
  683. replying to mail.  They are summarized in the following table.
  684.  
  685. `mh-comp-formfile'
  686.      Format file for drafts (default: `"components"').
  687.  
  688. `mh-repl-formfile'
  689.      Format file for replies (default: `"replcomps"').
  690.  
  691. `mh-letter-mode-hook'
  692.      Functions to run in MH-Letter mode (default: `nil').
  693.  
  694. `mh-compose-letter-function'
  695.      Functions to run when starting a new draft (default: `nil').
  696.  
  697. `mh-reply-default-reply-to'
  698.      Whom reply goes to (default: `nil').
  699.  
  700. `mh-forward-subject-format'
  701.      Format string for forwarded message subject (default: `"%s: %s"').
  702.  
  703. `mh-redist-full-contents'
  704.      `send' requires entire message (default: `nil').
  705.  
  706. `mh-new-draft-cleaned-headers'
  707.      Remove these header fields from re-edited draft (default:
  708.      `"^Date:\\| ^Received:\\| ^Message-Id:\\| ^From:\\| ^Sender:\\|
  709.      ^Delivery-Date:\\| ^Return-Path:"').
  710.  
  711.    Since mh-e does not use `comp' to create the initial draft, you need
  712. to set `mh-comp-formfile' to the name of your components file if it
  713. isn't `components'.  This is the name of the file that contains the
  714. form for composing messages.  If it does not contain an absolute
  715. pathname, mh-e searches for the file first in your MH directory and
  716. then in the system MH library directory (such as `/usr/local/lib/mh').
  717. Replies, on the other hand, are built using `repl'.  You can change the
  718. location of the field file from the default of `replcomps' by modifying
  719. `mh-repl-formfile'.
  720.  
  721.    Two hooks are provided to run commands on your freshly created draft.
  722. The first hook, `mh-letter-mode-hook', allows you to do some processing
  723. before editing a letter.  For example, you may wish to modify the
  724. header after `repl' has done its work, or you may have a complicated
  725. `components' file and need to tell mh-e where the cursor should go.
  726. Here's an example of how you would use this hook--all of the other
  727. hooks are set in this fashion as well.
  728.  
  729.      Prepare draft for editing via mh-letter-mode-hook
  730.      
  731.      (defvar letter-mode-init-done nil
  732.        "Non-`nil' when one-time mh-e settings have made.")
  733.      
  734.      (defun my-mh-letter-mode-hook ()
  735.        "Hook to prepare letter for editing."
  736.        (if (not letter-mode-init-done)    ; only need to bind the keys once
  737.            (progn
  738.              (local-set-key "\C-ctb" 'add-enriched-text)
  739.              (local-set-key "\C-cti" 'add-enriched-text)
  740.              (local-set-key "\C-ctf" 'add-enriched-text)
  741.              (local-set-key "\C-cts" 'add-enriched-text)
  742.              (local-set-key "\C-ctB" 'add-enriched-text)
  743.              (local-set-key "\C-ctu" 'add-enriched-text)
  744.              (local-set-key "\C-ctc" 'add-enriched-text)
  745.              (setq letter-mode-init-done t)))
  746.        (setq fill-prefix "  ")            ; I find indented text easier to read
  747.        (save-excursion
  748.          (goto-char (point-max))          ; go to end of message to
  749.          (mh-insert-signature)))          ;   insert signature
  750.      
  751.      (add-hook 'mh-letter-mode-hook 'my-mh-letter-mode-hook)
  752.  
  753.    The function, `add-enriched-text' is defined in the example in *Note
  754. Customizing Editing MIME::.
  755.  
  756.    The second hook, a function really, is `mh-compose-letter-function'.
  757. Like `mh-letter-mode-hook', it is called just before editing a new
  758. message; however, it is the last function called before you edit your
  759. message.  The consequence of this is that you can write a function to
  760. write and send the message for you.  This function is passed three
  761. arguments: the contents of the `To:', `Subject:', and `cc:' header
  762. fields.
  763.  
  764. * Menu:
  765.  
  766. * Customizing Replying::
  767. * Customizing Forwarding::
  768. * Customizing Redistributing::
  769. * Customizing Old Drafts::
  770.  
  771. 
  772. File: mh-e,  Node: Customizing Replying,  Next: Customizing Forwarding,  Prev: Customizing Sending,  Up: Customizing Sending
  773.  
  774. Replying to Mail
  775. ----------------
  776.  
  777.    If you find that most of the time that you specify `cc' when you
  778. reply to a message, set `mh-reply-default-reply-to' to `cc'.  This
  779. variable is normally set to `nil' so that you are prompted for the
  780. recipient of a reply.  It can be set to one of `from', `to', or `cc';
  781. you are then no longer prompted for the recipient(s) of your reply.
  782.  
  783. 
  784. File: mh-e,  Node: Customizing Forwarding,  Next: Customizing Redistributing,  Prev: Customizing Replying,  Up: Customizing Sending
  785.  
  786. Forwarding Mail
  787. ---------------
  788.  
  789.    When forwarding a message, the format of the `Subject:' header field
  790. can be modified by the variable `mh-forward-subject-format'.  This
  791. variable is a string which includes two escapes (`%s').  The first `%s'
  792. is replaced with the sender of the original message, and the second one
  793. is replaced with the original `Subject:'.  The default value of `"%s:
  794. %s"' takes a message with the header:
  795.  
  796.      To: Bill Wohler <wohler@newt.com>
  797.      Subject: Re: 49er football
  798.      From: Greg DesBrisay <gd@cellnet.com>
  799.  
  800.    and creates a subject header field of:
  801.  
  802.      Subject: Greg DesBrisay: Re: 49er football
  803.  
  804. 
  805. File: mh-e,  Node: Customizing Redistributing,  Next: Customizing Old Drafts,  Prev: Customizing Forwarding,  Up: Customizing Sending
  806.  
  807. Redistributing Your Mail
  808. ------------------------
  809.  
  810.    The variable `mh-redist-full-contents' must be set to non-`nil' if
  811. `dist' requires the whole letter for redistribution, which is the case
  812. if `send' is compiled with the BERK (1)  option (which many people
  813. abhor).  If you find that MH will not allow you to redistribute a
  814. message that has been redistributed before, this variable should be set
  815. to `nil'.
  816.  
  817.    ---------- Footnotes ----------
  818.  
  819.    (1)  To see which options your copy of MH was compiled with, use
  820. `M-x mh-version' (*Note Miscellaneous::).
  821.  
  822. 
  823. File: mh-e,  Node: Customizing Old Drafts,  Prev: Customizing Redistributing,  Up: Customizing Sending
  824.  
  825. Editing Old Drafts and Bounced Messages
  826. ---------------------------------------
  827.  
  828.    The header fields specified by `mh-new-draft-cleaned-headers' are
  829. removed from an old draft that has been recreated with `M-e'
  830. (`mh-extract-rejected-mail') or `M-a' (`mh-edit-again').  If when you
  831. edit an old draft with these commands you find that there are header
  832. fields that you don't want included, you can append them to this
  833. variable.  For example,
  834.  
  835.      (setq mh-new-draft-cleaned-headers
  836.            (concat mh-new-draft-cleaned-headers "\\|^Some-Field:"))
  837.  
  838.    This appends the regular expression `\\|^Some-Field:' to the
  839. variable (*note Syntax of Regular Expressions: (emacs)Regexps.).  The
  840. `\\|' means *or*, and the `^' (caret) matches the beginning of the
  841. line.  This is done to be very specific about which fields match.  The
  842. literal `:' is appended for the same reason.
  843.  
  844. 
  845. File: mh-e,  Node: Customizing Draft Editing,  Next: Customizing Moving Mail,  Prev: Customizing Sending,  Up: Customizing mh-e
  846.  
  847. Editing a Draft
  848. ===============
  849.  
  850.    There are several variables used during the draft editing phase.
  851. Examples include changing the name of the file that holds your signature
  852. or telling mh-e about new multimedia types.  They are:
  853.  
  854. `mh-yank-from-start-of-msg'
  855.      How to yank when region not set (default: `t').
  856.  
  857. `mh-ins-buf-prefix'
  858.      Indent for yanked messages (default: `"> "').
  859.  
  860. `mail-citation-hook'
  861.      Functions to run on yanked messages (default: `nil').
  862.  
  863. `mh-delete-yanked-msg-window'
  864.      Delete message window on yank (default: `nil').
  865.  
  866. `mh-mime-content-types'
  867.      List of valid content types (default: `'(("text/plain")
  868.      ("text/richtext") ("multipart/mixed") ("multipart/alternative")
  869.      ("multipart/digest") ("multipart/parallel") ("message/rfc822")
  870.      ("message/partial") ("message/external-body")
  871.      ("application/octet-stream") ("application/postscript")
  872.      ("image/jpeg") ("image/gif") ("audio/basic") ("video/mpeg"))').
  873.  
  874. `mh-mhn-args'
  875.      Additional arguments for `mhn' (default: `nil').
  876.  
  877. `mh-signature-file-name'
  878.      File containing signature (default: `"~/.signature"').
  879.  
  880. `mh-before-send-letter-hook'
  881.      Functions to run before sending draft (default: `nil').
  882.  
  883. `mh-send-prog'
  884.      MH program used to send messages (default: `"send"').
  885.  
  886. * Menu:
  887.  
  888. * Customizing Editing Textual::
  889. * Customizing Editing MIME::
  890. * Customizing Sending Message::
  891.  
  892. 
  893. File: mh-e,  Node: Customizing Editing Textual,  Next: Customizing Editing MIME,  Prev: Customizing Draft Editing,  Up: Customizing Draft Editing
  894.  
  895. Editing Textual Messages
  896. ------------------------
  897.  
  898.    The following two sections include variables that customize the way
  899. you edit a draft.  The discussion here applies to editing multimedia
  900. messages as well.
  901.  
  902. * Menu:
  903.  
  904. * Customizing Inserting Letter::
  905. * Customizing Signature::
  906.  
  907. 
  908. File: mh-e,  Node: Customizing Inserting Letter,  Next: Customizing Signature,  Prev: Customizing Editing Textual,  Up: Customizing Editing Textual
  909.  
  910. Inserting letter to which you're replying
  911. .........................................
  912.  
  913.    To control how much of the message to which you are replying is
  914. yanked by `C-c C-y' (`mh-yank-cur-msg') into your reply, modify
  915. `mh-yank-from-start-of-msg'.  The default value of `t' means that the
  916. entire message is copied.  If it is set to `'body' (don't forget the
  917. apostrophe), then only the message body is copied.  If it is set to
  918. `nil', only the part of the message following point (the current cursor
  919. position in the message's buffer) is copied.  In any case, this
  920. variable is ignored if a region is set in the message you are replying
  921. to.  The string contained in `mh-ins-buf-prefix' is inserted before
  922. each line of a message that is inserted into a draft with `C-c C-y'
  923. (`mh-yank-cur-msg').  I suggest that you not modify this variable.  The
  924. default value of `"> "' is the default string for many mailers and news
  925. readers: messages are far easier to read if several included messages
  926. have all been indented by the same string.  The variable
  927. `mail-citation-hook' is `nil' by default, which means that when a
  928. message is inserted into the letter, each line is prefixed by
  929. `mh-ins-buf-prefix'.  Otherwise, it can be set to a function that
  930. modifies an included citation.  (1) If you like to yank all the text
  931. from the message you're replying to in one go, set
  932. `mh-delete-yanked-msg-window' to non-`nil' to delete the window
  933. containing the original message after yanking it to make more room on
  934. your screen for your reply.
  935.  
  936.    ---------- Footnotes ----------
  937.  
  938.    (1)  *Supercite* is an example of a full-bodied, full-featured
  939. citation package.  It is in Emacs versions 19.15 and later, and can be
  940. found via anonymous `ftp' on `archive.cis.ohio-state.edu' in
  941. `/pub/gnu/emacs/elisp-archive/packages/sc3.1.tar.Z'
  942.  
  943. 
  944. File: mh-e,  Node: Customizing Signature,  Prev: Customizing Inserting Letter,  Up: Customizing Editing Textual
  945.  
  946. Inserting your signature
  947. ........................
  948.  
  949.    You can change the name of the file inserted with `C-c C-s'
  950. (`mh-insert-signature') by changing `mh-signature-file-name' (default:
  951. `"~/.signature"').
  952.  
  953. 
  954. File: mh-e,  Node: Customizing Editing MIME,  Next: Customizing Sending Message,  Prev: Customizing Editing Textual,  Up: Customizing Draft Editing
  955.  
  956. Editing Multimedia Messages
  957. ---------------------------
  958.  
  959.    The variable `mh-mime-content-types' contains a list of the
  960. currently valid content types.  They are listed in the table in *Note
  961. Customizing Draft Editing::.  If you encounter a new content type, you
  962. can add it like this:
  963.  
  964.      (setq mh-mime-content-types (append mh-mime-content-types
  965.                                          '(("NEW/TYPE"))))
  966.  
  967.    Emacs macros can be used to insert enriched text directives like
  968. `<bold>'.  The following code will make, for example, `C-c t b' insert
  969. the `<bold>' directive.
  970.  
  971.      Emacs macros for entering enriched text
  972.      
  973.      (defvar enriched-text-types '(("b" . "bold") ("i" . "italic") ("f" . "fixed")
  974.                                    ("s" . "smaller") ("B" . "bigger")
  975.                                    ("u" . "underline") ("c" . "center"))
  976.        "Alist of (final-character . directive) choices for add-enriched-text.
  977.      Additional types can be found in RFC 1563.")
  978.      
  979.      (defun add-enriched-text (begin end)
  980.        "Add enriched text directives around region.
  981.      The directive used comes from the list enriched-text-types and is
  982.      specified by the last keystroke of the command.  When called from Lisp,
  983.      arguments are BEGIN and END."
  984.        (interactive "r")
  985.        ;; Set type to the directive indicated by the last keystroke.
  986.        (let ((type (cdr (assoc (char-to-string (logior last-input-char ?`))
  987.                                enriched-text-types))))
  988.          (save-restriction              ; restores state from narrow-to-region
  989.            (narrow-to-region begin end) ; narrow view to region
  990.            (goto-char (point-min))      ; move to beginning of text
  991.            (insert "<" type ">")        ; insert beginning directive
  992.            (goto-char (point-max))      ; move to end of text
  993.            (insert "</" type ">"))))    ; insert terminating directive
  994.  
  995.    To use the function `add-enriched-text', first create keybindings
  996. for it (*note Customizing Sending::.).  Then, set the mark with `C-@'
  997. or `C-SPC', type in the text to be highlighted, and type `C-c t b'.
  998. This adds `<bold>' where you set the mark and adds `</bold>' at the
  999. location of your cursor, giving you something like: `You should be
  1000. <bold>very</bold>'.  You may also be interested in investigating
  1001. `sgml-mode'.
  1002.  
  1003. * Menu:
  1004.  
  1005. * Customizing Sending MIME::
  1006.  
  1007. 
  1008. File: mh-e,  Node: Customizing Sending MIME,  Prev: Customizing Editing MIME,  Up: Customizing Editing MIME
  1009.  
  1010. Readying multimedia messages for sending
  1011. ........................................
  1012.  
  1013.    If you wish to pass additional arguments to `mhn' to affect how it
  1014. builds your message, use the variable `mh-mhn-args'.  For example, you
  1015. can build a consistency check into the message by setting `mh-mhn-args'
  1016. to `-check'.  The recipient of your message can then run `mhn -check'
  1017. on the message--`mhn' will complain if the message has been corrupted
  1018. on the way.  The `C-c C-e' (`mh-mhn-edit') command only consults this
  1019. variable when given a prefix argument.
  1020.  
  1021. 
  1022. File: mh-e,  Node: Customizing Sending Message,  Prev: Customizing Editing MIME,  Up: Customizing Draft Editing
  1023.  
  1024. Sending a Message
  1025. -----------------
  1026.  
  1027.    If you want to check your spelling in your message before sending,
  1028. use `mh-before-send-letter-hook' like this:
  1029.  
  1030.    Spell-check message via mh-before-send-letter-hook
  1031.  
  1032.      (add-hook 'mh-before-send-letter-hook 'ispell-message)
  1033.  
  1034.    In case the MH `send' program is installed under a different name,
  1035. use `mh-send-prog' to tell mh-e the name.
  1036.  
  1037. 
  1038. File: mh-e,  Node: Customizing Moving Mail,  Next: Customizing Searching,  Prev: Customizing Draft Editing,  Up: Customizing mh-e
  1039.  
  1040. Moving Your Mail Around
  1041. =======================
  1042.  
  1043.    If you change the name of some of the MH programs or have your own
  1044. printing programs, the following variables can help you.  They are
  1045. described in detail in the subsequent sections.
  1046.  
  1047. `mh-inc-prog'
  1048.      Program to incorporate mail (default: `"inc"').
  1049.  
  1050. `mh-inc-folder-hook'
  1051.      Functions to run when incorporating mail (default: `nil').
  1052.  
  1053. `mh-delete-msg-hook'
  1054.      Functions to run when deleting messages (default: `nil').
  1055.  
  1056. `mh-print-background'
  1057.      Print in foreground or background (default: `nil').
  1058.  
  1059. `mh-lpr-command-format'
  1060.      Command used to print (default: `"lpr -J '%s'"').
  1061.  
  1062. `mh-default-folder-for-message-function'
  1063.      Function to generate a default folder (default: `nil').
  1064.  
  1065. `mh-auto-folder-collect'
  1066.      Collect folder names in background at startup (default: `t').
  1067.  
  1068. `mh-recursive-folders'
  1069.      Collect nested folders (default: `nil').
  1070.  
  1071. `mh-refile-msg-hook'
  1072.      Functions to run when refiling message (default: `nil').
  1073.  
  1074. `mh-store-default-directory'
  1075.      Default directory for storing files created by `uuencode' or `shar'
  1076.      (default: `nil').
  1077.  
  1078. `mh-sortm-args'
  1079.      Additional arguments for `sortm' (default: `nil').
  1080.  
  1081. `mh-scan-prog'
  1082.      Program to scan messages (default: `"scan"').
  1083.  
  1084. `mh-before-quit-hook'
  1085.      Functions to run before quitting (default: `nil').  See also
  1086.      `mh-quit-hook'.
  1087.  
  1088. `mh-quit-hook'
  1089.      Functions to run after quitting (default: `nil'). See also
  1090.      `mh-before-quit-hook'.
  1091.  
  1092. * Menu:
  1093.  
  1094. * Customizing Incorporating::
  1095. * Customizing Deleting::
  1096. * Customizing Organizing::
  1097. * Customizing Printing::
  1098. * Customizing Files and Pipes::
  1099. * Customizing Finishing Up::
  1100.  
  1101. 
  1102. File: mh-e,  Node: Customizing Incorporating,  Next: Customizing Deleting,  Prev: Customizing Moving Mail,  Up: Customizing Moving Mail
  1103.  
  1104. Incorporating Your Mail
  1105. -----------------------
  1106.  
  1107.    The name of the program that incorporates new mail is stored in
  1108. `mh-inc-prog'; it is `"inc"' by default.  This program generates a
  1109. one-line summary for each of the new messages.  Unless it is an
  1110. absolute pathname, the file is assumed to be in the `mh-progs'
  1111. directory.  You may also link a file to `inc' that uses a different
  1112. format (see `mh-profile'(5)).  You'll then need to modify several
  1113. variables appropriately; see `mh-scan-prog' below.  You can set the
  1114. hook `mh-inc-folder-hook', which is called after new mail is
  1115. incorporated by the `i' (`mh-inc-folder') command.  A good use of this
  1116. hook is to rescan the whole folder either after running `M-x mh-rmail'
  1117. the first time or when you've changed the message numbers from outside
  1118. of mh-e.
  1119.  
  1120.      Rescan folder after incorporating new mail via mh-inc-folder-hook
  1121.      
  1122.      (defun my-mh-inc-folder-hook ()
  1123.        "Hook to rescan folder after incorporating mail."
  1124.        (if (buffer-modified-p)            ; if outstanding refiles and deletes,
  1125.            (mh-execute-commands))         ;   carry them out
  1126.        (mh-rescan-folder)                 ; synchronize with +inbox
  1127.        (mh-show))                         ; show the current message
  1128.      
  1129.      (add-hook 'mh-inc-folder-hook 'my-mh-inc-folder-hook)
  1130.  
  1131. 
  1132. File: mh-e,  Node: Customizing Deleting,  Next: Customizing Organizing,  Prev: Customizing Incorporating,  Up: Customizing Moving Mail
  1133.  
  1134. Deleting Your Mail
  1135. ------------------
  1136.  
  1137.    The hook `mh-delete-msg-hook' is called after you mark a message for
  1138. deletion.  For example, the current maintainer of mh-e used this once
  1139. when he kept statistics on his mail usage.
  1140.  
  1141.